/*
 * Copyright (C) 冷锋
 */
#ifndef EPOLLSVRIO_H
#define EPOLLSVRIO_H

/************************************************************************/
/* Epoll服务器 (ET模式)                                                                    */
/************************************************************************/

#include <map>
#include <string.h>
#include <sys/epoll.h>
#include <sys/socket.h>
#include <arpa/inet.h>
#include "threadpool.h"
#include "thread.h"
#include "connmgr.h"
#include "svrio.h"
#include "defines.h"

class CEpollSvrIO:public CSvrIO
{
public:
	CEpollSvrIO(char*sIP,const short iPort);
protected:
	int ProcessEvent();
	void PrepareListenfd( );
	void AddConn( Connection*pConn,unsigned char flag );

protected:
	int m_epfd;//epoll描述符
	struct epoll_event m_Events[MAX_EVENT];
	socklen_t		   m_AddrLen ;
	struct sockaddr_in m_ClientAddr;
};



#endif
